package com.sc.nft.admin.controller;

import com.sc.nft.annotation.SysMemberLogin;
import com.sc.nft.entity.dto.StatementConditionDTO;
import com.sc.nft.entity.vo.*;
import com.sc.nft.entity.vo.ecology.EcologyDataVO;
import com.sc.nft.service.StatementService;
import com.sc.nft.sup.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/statement")
@Slf4j
@RequiredArgsConstructor
@Api(tags = "报表")
public class StatementController {

    private final StatementService statementService;

    @PostMapping(value = "/cumulativePart", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "累积部分统计", notes = "累积部分统计", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<CumulativePartVO> cumulativePart(@RequestBody StatementConditionDTO statementConditionDTO) {
        return Result.success(statementService.cumulativePart(statementConditionDTO));
    }

    @PostMapping(value = "/platformBalance", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "平台余额", notes = "平台余额", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<PlatformBalanceVO> platformBalance(@RequestBody StatementConditionDTO statementConditionDTO) {
        return Result.success(statementService.platformBalance(statementConditionDTO));
    }

    @PostMapping(value = "/chargePart", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "充值提取部分统计", notes = "充值提取部分统计", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<ChargePartVO> chargePart(@RequestBody StatementConditionDTO statementConditionDTO) {
        return Result.success(statementService.chargePart(statementConditionDTO));
    }

    @PostMapping(value = "/initialPublicOfferingsAndMarketing", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "首发以及市场销售", notes = "首发以及市场销售", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<InitialPublicOfferingsAndMarketingVO> initialPublicOfferingsAndMarketing(@RequestBody StatementConditionDTO statementConditionDTO) {
        return Result.success(statementService.initialPublicOfferingsAndMarketing(statementConditionDTO));
    }

    @PostMapping(value = "/tripartiteCommission", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "手续费 (单日产生的第三方手续费总和 (转账手续费 + 提现手续费 + 银行卡支付手续费）)", notes = "手续费 (单日产生的第三方手续费总和 (转账手续费 + 提现手续费 + 银行卡支付手续费）)", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<TripartiteCommissionVO> tripartiteCommission(@RequestBody StatementConditionDTO statementConditionDTO) {
        return Result.success(statementService.tripartiteCommission(statementConditionDTO));
    }

    @PostMapping(value = "/cashAndRedEnvelopesAreAwarded", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "现金和红包奖励发出", notes = "现金和红包奖励发出", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<CashAndRedEnvelopesAreAwardedVO> cashAndRedEnvelopesAreAwarded(@RequestBody StatementConditionDTO statementConditionDTO) {
        return Result.success(statementService.cashAndRedEnvelopesAreAwarded(statementConditionDTO));
    }

    @PostMapping(value = "/userDataPartStatistics", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "用户数据部分统计", notes = "用户数据部分统计", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<UserDataPartStatisticsVO> userDataPartStatistics(@RequestBody StatementConditionDTO statementConditionDTO) {
        return Result.success(statementService.userDataPartStatistics(statementConditionDTO));
    }

    @PostMapping(value = "/airdropStatistics", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "空投统计", notes = "空投统计", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<AirdropStatisticsVO> airdropStatistics(@RequestBody StatementConditionDTO statementConditionDTO) {
        return Result.success(statementService.airdropStatistics(statementConditionDTO));
    }

    @PostMapping(value = "/syntheticStatistics", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "合成统计", notes = "合成统计", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<SyntheticStatisticsVO> syntheticStatistics(@RequestBody StatementConditionDTO statementConditionDTO) {
        return Result.success(statementService.syntheticStatistics(statementConditionDTO));
    }


    @PostMapping(value = "/primaryMarketTransactionData", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "1级交易数据", notes = "1级交易数据", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<TransactionDataVO> primaryMarketTransactionData(@RequestBody StatementConditionDTO statementConditionDTO) {
        return Result.success(statementService.primaryMarketTransactionData(statementConditionDTO));
    }

    @PostMapping(value = "/primaryIncome", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "1级收益", notes = "1级收益", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<IncomeDataVO> primaryIncome(@RequestBody StatementConditionDTO statementConditionDTO) {
        return Result.success(statementService.primaryIncome(statementConditionDTO));
    }

    @PostMapping(value = "/freeSecondaryTradingData", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "自由二级交易数据", notes = "自由二级交易数据", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<TransactionDataVO> freeSecondaryTradingData(@RequestBody StatementConditionDTO statementConditionDTO) {
        return Result.success(statementService.freeSecondaryTradingData(statementConditionDTO));
    }

    @PostMapping(value = "/freeSecondaryIncomeData", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "2级收益", notes = "2级收益", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<IncomeDataVO> freeSecondaryIncomeData(@RequestBody StatementConditionDTO statementConditionDTO) {
        return Result.success(statementService.freeSecondaryIncomeData(statementConditionDTO));
    }

    @PostMapping(value = "/freeMarketTradingData", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "自由市场交易数据", notes = "自由市场交易数据", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<TransactionDataVO> freeMarketTradingData(@RequestBody StatementConditionDTO statementConditionDTO) {
        return Result.success(statementService.freeMarketTradingData(statementConditionDTO));
    }

    @PostMapping(value = "/recordFreeMarketReturns", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "自由市场收益", notes = "自由市场收益", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<IncomeDataVO> recordFreeMarketReturns(@RequestBody StatementConditionDTO statementConditionDTO) {
        return Result.success(statementService.recordFreeMarketReturns(statementConditionDTO));
    }

//    @PostMapping(value = "/getEcologyData", produces = MediaType.APPLICATION_JSON_VALUE)
//    @ApiOperation(value = "生态数据统计", notes = "生态数据统计", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//    @SysMemberLogin
//    public Result<EcologyDataVO> getEcologyData() {
//        return Result.success(statementService.getEcologyData());
//    }
}
